function getDouble(n) {
    return n * 2;
}
let obj = {};
let count = 1;
let double = getDouble(count);

let proxy = new Proxy(obj, {
    get: function(target, prop) {
        return target[prop]
    },
    set: function(target, prop, value) {
        target[prop] = value
        if (prop === 'count' ) {
            double = getDouble(value)
        }
    },
    deleteProperty: function(target, prop) {
        delete target[prop]
        if (prop === 'count') {
            double = NaN
        }
    }
})
console.log(obj.count, double)
proxy.count = 2
console.log(obj.count, double)
delete proxy.count
console.log(obj.count, double)